<!--{template common/header}-->
<div id="pt" class="bm cl">	
	<div class="z">
		<a href="./" class="nvhm" title="{lang homepage}">$_G[setting][bbname]</a> <em>&rsaquo;</em>
		<a href="plugin.php?id=dzapp_base">{lang dzapp_base:base}</a> <em>&rsaquo;</em>
		<a href="plugin.php?id=dzapp_base&mod=basecp">{lang dzapp_base:basecp}</a> <em>&rsaquo;</em>
		{lang dzapp_base:perm}
	</div>
</div>
<div id="ct" class="ct2_a wp cl">
	<div class="mn">
		<div class="bm bw0">
			<ul class="tb mbm cl">
				<li class="a"><a href="plugin.php?id=dzapp_base&mod=basecp&ac=perm">{lang dzapp_base:perm}</a></li>
			</ul>
			<form name="permform" method="post" action="plugin.php?id=dzapp_base&mod=basecp&ac=perm" onsubmit="return validate(this)">
				<input type="hidden" name="formhash" value="{FORMHASH}" />
				<input type="hidden" name="listsubmit" value="true" />
				<table cellspacing="0" cellpadding="0" class="dt mtm">
					<tr class="th">
						<th class="c">{lang dzapp_base:dels}</th>
						<th width="45">{lang dzapp_base:displayorder}</th>
						<th width="120">{lang dzapp_base:plugin}</th>
						<th width="90">{lang dzapp_base:module}</th>
						<th>{lang dzapp_base:user}</th>
						<th width="30">{lang dzapp_base:open}</th>
						<th width="30">{lang dzapp_base:available}</th>
					</tr>
					<!--{loop $list $key $value}-->
					<tr>
						<td><input type="checkbox" name="delete[]" class="pc" value="$key" /></td>
						<td><input type="text" name="displayorder[$key]" class="px" value="$value[displayorder]" style="width: 35px" /></td>
						<td><input type="text" name="plugin[$key]" class="px" value="$value[plugin]" style="width: 110px" /></td>
						<td><input type="text" name="module[$key]" class="px" value="$value[module]" style="width: 80px" /></td>
						<td><input type="text" name="user[$key]" class="px" value="$value[user]" style="width: 98%" /></td>
						<td><input type="checkbox" name="open[$key]" class="pc" value="1"{if $value[open]} checked="checked"{/if} /></td>
						<td><input type="checkbox" name="available[$key]" class="pc" value="1"{if $value[available]} checked="checked"{/if} /></td>
					</tr>
					<!--{/loop}-->
					<tr>
						<td></td>
						<td colspan="30"><img class="vm" src="static/image/common/addicn.gif"> <a href="javascript:;" onclick="addrow(this, 0)">{lang dzapp_base:perm_add}</a></td>
					</tr>
					<tr class="bw0_all">
						<td><input type="checkbox" name="chkall" id="chkall" class="pc" onclick="checkall(this.form, 'delete')"><label for="chkall">{lang dzapp_base:dels}</label></td>
						<td colspan="30"><button type="submit" name="submit" id="submit" class="pn" value="true"><strong>{lang dzapp_base:submit}</strong></button></td>
					</tr>
				</table>
			</form>
			<script type="text/javascript">
			var rowtypedata = [[[1, ''], [1, '<input type="text" name="newdisplayorder[]" class="px" style="width: 35px" />'], [1, '<input type="text" name="newplugin[]" class="px" style="width: 110px" />'], [1, '<input type="text" name="newmodule[]" class="px" style="width: 80px" />'], [1, '<input type="text" name="newuser[]" class="px" style="width: 98%" />'], [1, '<input type="checkbox" name="newopen[]" class="pc" value="1" />'], [1, '<input type="checkbox" name="newavailable[]" class="pc" value="1" />']]];
			function addrow(obj, type) {
				var table = obj.parentNode.parentNode.parentNode.parentNode;
				var row = table.insertRow(obj.parentNode.parentNode.rowIndex);
				var typedata = rowtypedata[type];
				for(var i = 0; i <= typedata.length - 1; i++) {
					var cell = row.insertCell(i);
					if(typedata[i][0] > 1) cell.colSpan = typedata[i][0];
					var tmp = typedata[i][1];
					if(typedata[i][2]) {
						cell.className = typedata[i][2];
					}
					tmp = tmp.replace(/\{(\d+)\}/g, function($1, $2) {return addrow.arguments[parseInt($2) + 1];});
					cell.innerHTML = tmp;
				}
			}
			function validate(theform) {
				var delcheck = false;
				for(var i = 0; i < theform.elements.length; i++) {
					var e = theform.elements[i];
					if(e.name=='delete[]' && e.checked) delcheck = true;
				}
				if(delcheck){
					if(!confirm('{lang dzapp_base:delete_confirm}')) return false;
				}
			}
			</script>
		</div>
	</div>
	<div class="appl">
		<!--{subtemplate dzapp_base:basecp_nav}-->
	</div>
</div>
<!--{template common/footer}-->